package com.xhwl.logistics.service.cent.server;

import com.alibaba.fastjson.JSON;
import com.xhwl.common.dto.cent.vehicle.feign.VehicleFindCarQuery;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.logistics.bo.VehicleFindCarBO;
import com.xhwl.logistics.bo.input.QueryVehicleFindCarBO;
import com.xhwl.logistics.converter.mapstruct.VehicleFindCarConverter;
import com.xhwl.logistics.service.business.VehicleFindCarBusinessService;
import org.springframework.beans.factory.annotation.Autowired;

//@Service
public class VehicleFindCarFeignServiceImpl implements IVehicleFindCarFeignService {

    @Autowired
    private VehicleFindCarConverter vehicleFindCarConverter;

    @Autowired
    private VehicleFindCarBusinessService vehicleFindCarBusinessService;

    @Override
    public ResultJson<String> findCar(VehicleFindCarQuery vehicleFindCarQuery) {
        QueryVehicleFindCarBO queryVehicleFindCarBO = vehicleFindCarConverter.vehicleFindCarQuery2QueryVehicleFindCarBO(vehicleFindCarQuery);

        VehicleFindCarBO vehicleFindCarBO = vehicleFindCarBusinessService.findCar(queryVehicleFindCarBO);
        return ResultJson.successWithResult(JSON.toJSONString(vehicleFindCarBO));
    }
}
